package com.sds.sweng.swat.miplatform.ui.design.models.area.sub;

import org.codehaus.jackson.annotate.JsonIgnore;

import com.sds.sweng.swat.miplatform.ui.design.models.MiplatformDesignModel;

public class TabContentsSubArea extends SubArea {

	public TabContentsSubArea() {

	}

	@JsonIgnore
	public void setContents(MiplatformDesignModel contents) {
		if (getChildren().size() > 0) {
			if (!getChildren().get(0).equals(contents)) {
				getChildren().remove(0);
				getChildren().add(contents);

				fireStructureChange(CHILDREN, contents);
			}
		} else {
			addChild(contents);
		}
	}

	@Override
	public boolean isEmpty() {
		return true;
	}

	@Override
	public int getRemainWidth() {
		return 0;
	}

	public boolean isFixed() {
		return true;
	}

	@Override
	public int getRequireWidth() {
		return getWidth();
	}

}
